<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>约战</title>
<link rel="stylesheet" type="text/css"
	href="../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"
	href="../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"
	href="../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"
	href="../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="../static/js/themes/icon.css">
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../static/js/jquery.md5.js"></script>
<script type="text/javascript" src="../static/js/index.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
	String para = request.getParameter("f_pa_id");
	int f_pa_resourceId = 0;
	if(para != null)
		f_pa_resourceId = Integer.valueOf(para);
	String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
	$(function() {
		var f_pa_id = <%=f_pa_resourceId%>;
		$.ajax({
			url:"attribute_show.do?f_pa_id="+f_pa_id,
			success:function(data){
				var user = JSON.parse(data);
				$("#f_pa_id").val(user.f_pa_id);
				$("#f_pa_name").val(user.f_pa_name);
				$("#f_pa_url").val(user.f_pa_url);
				$("#f_pa_desc").val(user.f_pa_desc);
				$("#f_pa_status").val(user.f_pa_status);
			}
		});
		$("#contentForm").validate({
			rules: {
				f_pa_name: {
					required: true,
					maxlength: 50
				},
				f_pa_url: {
					required: true
				}
			},
			messages: {
				f_pa_name: {
					required: "请输入属性名称",
					maxlength: "属性名称不能超过50位"
				},
				f_pa_url: {
					required: "请输入属性路径"
				}
			},
			
		});
	});

	function _submitFm() {
	  if($("#contentForm").validate().form()) {
		app_ajax('attribute_edit.do', $("#contentForm").serialize(), function(data) {
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
		});
	  }
	}
</script>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：属性管理 &gt; 属性修改</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data"
					name="formName">
					<input type="hidden" id="f_pa_id" name="f_pa_id" value="" />
					<legend>属性修改</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="30%" align="right"><span class="red">*</span>属性名称：</td>
									<td width="70%"><input name="f_pa_name" id="f_pa_name"
										style="width: 150px;" value="" class="yl_inp yw_name" /> <span
										id="f_pa_name_tip" class="tip"></span></td>
								</tr>
							</table>
						</div>
					</fieldset>

					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="30%" align="right"><span class="red">*</span>属性路径：</td>
									<td width="70%"><input name="f_pa_url" id="f_pa_url"
										style="width: 150px;" value="" class="yl_inp yw_name" /> <span
										id="f_pa_url_tip" class="tip"></span></td>
								</tr>
							</table>
						</div>
					</fieldset>

					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="30%" align="right">属性简介：</td>
									<td width="70%"><textarea id="f_pa_desc" cols="20"
											rows="4" style="resize: none; width: 150px;" name="f_pa_desc"></textarea>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>

					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="30%" align="right">属性状态：</td>
									<td width="70%"><select name="f_pa_status"
										id="f_pa_status" style="width: 150px;">
											<option value="0">未知</option>
											<option value="1">有效</option>
											<option value="2">无效</option>
									</select> <span id="f_pa_status_tip" class="tip"></span></td>
								</tr>
							</table>
						</div>
					</fieldset>
					<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
					<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
				</form>
			</div>
			<div class="toolbar" style="text-align: center;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
					href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
					href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
					class="easyui-linkbutton"
					onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
			</div>
		</div>
		<!--主体 结束-->
	</div>
</html>
